[all packages] [package pizza.lang] [class hierarchy] [index]

public final class pizza.lang.ListBuffer<A>

(source file: pizza/lang/ListBuffer.pizza)
java.lang.Object
   |
   +----pizza.lang.ListBuffer<A>

The pure class interface.
public final class ListBuffer<A>
This Class is a growable buffer for lists. It's modelled after class java.lang.StringBuffer. It is mainly used to create Lists. Note that the method toList() does not create a copy of the internal buffer. Instead the buffer is marked as shared. Any further changes to the buffer will cause a copy to be made.

Parameters:
A - the type of elements to store in the ListBuffer
See also:
List

Constuctor Index

O ListBuffer()
Constructs an empty List buffer.

Methods

O append(A)
Appends a new element to the end and returns the buffer. If the buffer was shared a copy of
O elements()
Returns an enumeration of all elements.
O getAt(int)
Returns an element of the buffer.
O insert(int, A)
Inserts an element into this buffer.
O length()
Returns the length (element count) of the buffer.
O prepend(A)
Prepends an element to the beginning of this buffer.
O remove(int)
Removes first `n' elements in this buffer.
O setAt(int, A)
Updates an element in the buffer.
O setLength(int)
Truncates buffer to a maximum of `n' elements.
O toList()
Converts to a List representing the data in the buffer.
O toString()
Returns a string representation of this buffer.

Constructors

O ListBuffer
public ListBuffer();
Constructs an empty List buffer.

Methods

O length
public int length();
Returns